package com.e2oto.seller.common.base;

import android.os.Bundle;


/**
 * Created by ZhangLiQiang on 2017/8/5.
 */

public abstract class BaseMvpFragment<V,P extends BasePresenter<V>> extends LazyFragment {

    protected P presenter;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        presenter = createPresenter();
        presenter.attachView((V)this);

    }

    @Override
    public void onDestroy() {
        presenter.detachView();
        super.onDestroy();
    }

    //实例化Presenter
    public abstract P createPresenter();
}